﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CRMSalesManagement
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            //string name = this.UserName.Text.Trim();
            //string passwore = this.Password.Text.Trim();
            //var resut = CRM.Business.Login.GetUserByUserID(name, passwore);//判断输入的id和密码是否与数据库中的数据一致
            //if (resut != null)//如果一致
            //{
            //    //记录登录者
            //    Session["userName"] = name;//将获取的nameid做为session值
            //    if (resut.power == "销售人员")//如果是销售人员，则跳转到销售人员的页面
            //        Response.Redirect("~/Manage/SalesmanManage/Customer/MainCustomer.aspx");
            //    else if (resut.power == "销售总监")//如果是销售总监，则跳转到销售总监的页面
            //        Response.Redirect("~/Manage/SalesMonitor/Customers.aspx");
            //    else  //如果是管理员人员，则跳转到管理员的页面
            //        Response.Redirect("~/Manage/Administrator/AdminFirstForm.aspx");
            //}
            //else  //如果不一致，即不存在这样的用户
            //{
            //    this.errorMessage.Text = "用户名或密码输入错误！";//出现错误提示文本框
            //}
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Login.aspx");//点击取消按钮，返回登录首页
        }
    }
}